/**
 * 业务相关常量定义
 */

// 角色类型
export const ROLE_TYPE = {
  SYSTEM: 'system',
  CUSTOM: 'custom',
  TENANT: 'tenant',
  PLATFORM: 'platform',
} as const;

// 角色颜色映射
export const ROLE_COLOR_MAP = {
  admin: 'red',
  tech_manager: 'blue',
  developer: 'purple',
  frontend_dev: 'cyan',
  backend_dev: 'geekblue',
  tester: 'green',
  designer: 'orange',
  product_manager: 'volcano',
  sales_manager: 'gold',
  sales_rep: 'lime',
  hr_manager: 'magenta',
  finance_manager: 'blue',
  // 平台角色
  super_admin: 'red',
  platform_admin: 'blue',
  platform_operator: 'cyan',
  platform_support: 'green',
  platform_auditor: 'purple',
} as const;

// 权限类型
export const PERMISSION_TYPE = {
  MENU: 'menu',
  BUTTON: 'button',
  API: 'api',
  DATA: 'data',
} as const;

// 权限级别
export const PERMISSION_LEVEL = {
  SYSTEM: 'system',
  TENANT: 'tenant',
  PLATFORM: 'platform',
} as const;

// 部门级别
export const DEPARTMENT_LEVEL = {
  COMPANY: 1,
  DIVISION: 2,
  DEPARTMENT: 3,
  TEAM: 4,
} as const;

// 用户业务状态（扩展）
export const USER_BUSINESS_STATUS = {
  ACTIVE: 'active',
  INACTIVE: 'inactive',
  LOCKED: 'locked',
  PENDING: 'pending',
} as const;

// 租户状态
export const TENANT_STATUS = {
  ACTIVE: 'active',
  SUSPENDED: 'suspended',
  EXPIRED: 'expired',
  TRIAL: 'trial',
} as const;

// 租户规模
export const TENANT_SCALE = {
  STARTUP: 'startup',
  SMALL: 'small',
  MEDIUM: 'medium',
  LARGE: 'large',
  ENTERPRISE: 'enterprise',
} as const;

// 租户规模文本映射
export const TENANT_SCALE_TEXT_MAP = {
  [TENANT_SCALE.STARTUP]: '初创公司',
  [TENANT_SCALE.SMALL]: '小型企业',
  [TENANT_SCALE.MEDIUM]: '中型企业',
  [TENANT_SCALE.LARGE]: '大型企业',
  [TENANT_SCALE.ENTERPRISE]: '集团企业',
} as const;

// 订阅计划
export const SUBSCRIPTION_PLAN = {
  FREE: 'free',
  BASIC: 'basic',
  PROFESSIONAL: 'professional',
  ENTERPRISE: 'enterprise',
  CUSTOM: 'custom',
} as const;

// 订阅计划文本映射
export const SUBSCRIPTION_PLAN_TEXT_MAP = {
  [SUBSCRIPTION_PLAN.FREE]: '免费版',
  [SUBSCRIPTION_PLAN.BASIC]: '基础版',
  [SUBSCRIPTION_PLAN.PROFESSIONAL]: '专业版',
  [SUBSCRIPTION_PLAN.ENTERPRISE]: '企业版',
  [SUBSCRIPTION_PLAN.CUSTOM]: '定制版',
} as const;

// 订阅状态
export const SUBSCRIPTION_STATUS = {
  ACTIVE: 'active',
  EXPIRED: 'expired',
  CANCELLED: 'cancelled',
  SUSPENDED: 'suspended',
} as const;

// 工单类型
export const TICKET_TYPE = {
  TECHNICAL: 'technical',
  BUSINESS: 'business',
  BILLING: 'billing',
  OTHER: 'other',
} as const;

// 工单类型文本映射
export const TICKET_TYPE_TEXT_MAP = {
  [TICKET_TYPE.TECHNICAL]: '技术问题',
  [TICKET_TYPE.BUSINESS]: '业务咨询',
  [TICKET_TYPE.BILLING]: '账务问题',
  [TICKET_TYPE.OTHER]: '其他',
} as const;

// 工单优先级
export const TICKET_PRIORITY = {
  LOW: 'low',
  MEDIUM: 'medium',
  HIGH: 'high',
  URGENT: 'urgent',
} as const;

// 工单优先级文本映射
export const TICKET_PRIORITY_TEXT_MAP = {
  [TICKET_PRIORITY.LOW]: '低',
  [TICKET_PRIORITY.MEDIUM]: '中',
  [TICKET_PRIORITY.HIGH]: '高',
  [TICKET_PRIORITY.URGENT]: '紧急',
} as const;

// 工单状态
export const TICKET_STATUS = {
  OPEN: 'open',
  IN_PROGRESS: 'in_progress',
  RESOLVED: 'resolved',
  CLOSED: 'closed',
} as const;

// 工单状态文本映射
export const TICKET_STATUS_TEXT_MAP = {
  [TICKET_STATUS.OPEN]: '待处理',
  [TICKET_STATUS.IN_PROGRESS]: '处理中',
  [TICKET_STATUS.RESOLVED]: '已解决',
  [TICKET_STATUS.CLOSED]: '已关闭',
} as const;

// 操作结果
export const OPERATION_RESULT = {
  SUCCESS: 'success',
  FAILURE: 'failure',
  PARTIAL: 'partial',
} as const;

// 操作结果文本映射
export const OPERATION_RESULT_TEXT_MAP = {
  [OPERATION_RESULT.SUCCESS]: '成功',
  [OPERATION_RESULT.FAILURE]: '失败',
  [OPERATION_RESULT.PARTIAL]: '部分成功',
} as const;

// 服务状态
export const SERVICE_STATUS = {
  RUNNING: 'running',
  STOPPED: 'stopped',
  ERROR: 'error',
  WARNING: 'warning',
} as const;

// 服务状态文本映射
export const SERVICE_STATUS_TEXT_MAP = {
  [SERVICE_STATUS.RUNNING]: '运行中',
  [SERVICE_STATUS.STOPPED]: '已停止',
  [SERVICE_STATUS.ERROR]: '异常',
  [SERVICE_STATUS.WARNING]: '警告',
} as const;

// 告警级别
export const ALERT_LEVEL = {
  INFO: 'info',
  WARNING: 'warning',
  CRITICAL: 'critical',
} as const;

// 告警级别文本映射
export const ALERT_LEVEL_TEXT_MAP = {
  [ALERT_LEVEL.INFO]: '信息',
  [ALERT_LEVEL.WARNING]: '警告',
  [ALERT_LEVEL.CRITICAL]: '严重',
} as const;